home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.4 KB | 35 lines | [TEXT/GEOL] |
- Item 3055273 21-May-90 13:44PDT
-
- From: DEREK White, Derek
-
- To: UK0320 Desktop Communications Ltd,IDV
- MACAPP.TECH$ MacApp Technical
-
- Sub: Re-External Objects in Pascal
-
- Paul,
-
- The way I remember it, forward or external object type references can be used
- as a field type (and some other places), because all the compiler needs to know
- (at the declaration point) is how much space to allocate for the field, and all
- object references are 4 bytes. Inheriting from an object-types requires that
- the compiler know all about the ancestor, so you can't inherit from a forward
- or external object type.
-
- I think you're kind of stuck for now. In a future version of the compiler,
- you might be able to have a USES clause in the IMPLEMENTATION section of a
- unit, so in your example, unitB wouldn't use unitA in it's interface, but it
- would in it's implementation, so when unitA gets read in, ObjB is fully
- defined.
-
- For now I suggest that the fObjA field in TObjB be of type TObjB (instead
- of TObjA). Thsi would eliminate the need for the mutual uses for this example.
- Since TObjA is a descendant of TObjB, this should work in all cases except when
- you want to call a TObjA method on fObjA. Then you would need to do a (gross
- looking) type coercion.
-
- Gook Luck,
- - Derek White
- - ATG East/Columbia
-
-